package com.wudl.flink.core

import org.apache.flink.streaming.api.scala.StreamExecutionEnvironment

/**
 * @ClassName : SourceFile
 * @Description : 读取文件的数据源
 * @Author :wudl
 * @Date: 2020-12-02 00:34
 */
object FlinkFlieSource {
  def main(args: Array[String]): Unit = {
    val env = StreamExecutionEnvironment.getExecutionEnvironment
    // 设置并行度
    env.setParallelism(1)
    //导入隐式转换，建议写在这里，可以防止IDEA代码提示出错的问题
    import org.apache.flink.streaming.api.scala._
    val dataStream:DataStream[String] = env.readTextFile("F:\\ideaWorkSpace2020\\jg\\Flinklearning\\flink-core\\src\\main\\scala\\com\\wudl\\flink\\core\\FlinkFlieSource.scala")
    dataStream.print()
    env.execute("从文件读取数据源")

  }

}
